
<script setup>
import sonCom from './components/sonCom.vue'
import { onMounted, ref } from 'vue'
const h1Ref = ref(null)
const sonRef = ref(null)
const message = ref('hello')
onMounted(() => {
  console.log(h1Ref.value)
})
const getSon = () => {
  sonRef.value.validate()
}
</script>
<template>
<h1 ref="h1Ref">hello</h1>
<sonCom :msg="message" ref="sonRef"/>
<button @click="getSon">获取组件实例</button>
</template>
<style>
/* 样式 */
</style>
